this.BX=this.BX||{};this.BX.Vue3=this.BX.Vue3||{};(function(a,s){"use strict";const t="bx-lazyload-watch";const e="bx-lazyload-loading";const l="bx-lazyload-success";const c="bx-lazyload-error";const o="bx-lazyload-hidden";const i="data:image/svg+xml,%3Csvg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E";const d={beforeMount(a,s){if(typeof s.value==="object"&&typeof s.value.callback==="function"){a.lazyloadCallback=s.value.callback}if(!a.src||a.src===location.href.replace(location.hash,"")){a.src=i}if(n){n.observe(a)}else{r(a)}},updated(a){if(!a.classList.contains(l)&&!a.classList.contains(c)&&!a.classList.contains(t)&&!a.classList.contains(e)){a.classList.add(e)}else if((a.classList.contains(l)||a.classList.contains(c))&&a.dataset.lazyloadSrc&&a.dataset.lazyloadSrc!==a.src){if(!a.dataset.lazyloadSrc.startsWith("http")){const s=document.createElement("a");s.href=a.dataset.lazyloadSrc;if(s.href===a.src){return}}r(a)}},unmounted(a){if(n){n.unobserve(a)}}};let n=null;let r=function(a,s){let d=a.dataset.lazyloadSuccessClass?a.dataset.lazyloadSuccessClass.split(" "):[];delete a.dataset.lazyloadSuccessClass;d=[l,...d];let r=a.dataset.lazyloadErrorClass?a.dataset.lazyloadErrorClass.split(" "):[];delete a.dataset.lazyloadErrorClass;r=[c,...r];a.classList.add(e);const f=new Image;f.src=a.dataset.lazyloadSrc;if(!a.dataset.lazyloadHiddenSrc){a.dataset.lazyloadHiddenSrc=a.src}f.onload=function(){if(a.classList.contains(o)){return false}if(a.dataset.lazyloadSrc){a.src=a.dataset.lazyloadSrc}a.classList.remove(e);a.classList.add(...d);if(typeof a.lazyloadCallback==="function"){a.lazyloadCallback({element:a,state:"success"});delete a.lazyloadCallback}};f.onerror=function(){if(a.classList.contains(o)){return false}a.classList.remove(e);a.classList.add(...r);a.title="";a.alt="";if(typeof a.lazyloadCallback==="function"){a.lazyloadCallback({element:a,state:"error"});delete a.lazyloadCallback}else{a.src=i}};if(typeof a.dataset.lazyloadDontHide!=="undefined"){a.classList.remove(t);delete a.dataset.lazyloadDontHide;if(n){n.unobserve(a)}}};if(typeof window.IntersectionObserver!=="undefined"){n=new IntersectionObserver((function(a,s){a.forEach((function(a){const s=a.target;if(s.classList.contains(c)){return true}if(a.isIntersecting){if(s.classList.contains(o)){if(s.dataset.lazyloadSrc){s.src=s.dataset.lazyloadSrc}s.classList.remove(o)}else if(s.classList.contains(t)){return true}else{s.classList.add(t);r(s)}}else{if(s.classList.contains(o)||!s.classList.contains(t)){return true}if(s.dataset.lazyloadHiddenSrc){s.src=s.dataset.lazyloadHiddenSrc}s.classList.remove(e);s.classList.add(o)}}))}),{threshold:[0,1]})}a.lazyload=d})(this.BX.Vue3.Directives=this.BX.Vue3.Directives||{},BX.Vue3);
//# sourceMappingURL=lazyload.bundle.map.js